<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>blmc_robots: blmc_robots::NJointBlmcRobotDriver&lt; N_JOINTS, N_MOTOR_BOARDS &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">blmc_robots
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classblmc__robots_1_1NJointBlmcRobotDriver.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classblmc__robots_1_1NJointBlmcRobotDriver-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">blmc_robots::NJointBlmcRobotDriver&lt; N_JOINTS, N_MOTOR_BOARDS &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Base class for simple n-joint BLMC robots.  
 <a href="classblmc__robots_1_1NJointBlmcRobotDriver.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="n__joint__blmc__robot__driver_8hpp_source.html">n_joint_blmc_robot_driver.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for blmc_robots::NJointBlmcRobotDriver&lt; N_JOINTS, N_MOTOR_BOARDS &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classblmc__robots_1_1NJointBlmcRobotDriver__inherit__graph.png" border="0" usemap="#blmc__robots_1_1NJointBlmcRobotDriver_3_01N__JOINTS_00_01N__MOTOR__BOARDS_01_4_inherit__map" alt="Inheritance graph"/></div>
<map name="blmc__robots_1_1NJointBlmcRobotDriver_3_01N__JOINTS_00_01N__MOTOR__BOARDS_01_4_inherit__map" id="blmc__robots_1_1NJointBlmcRobotDriver_3_01N__JOINTS_00_01N__MOTOR__BOARDS_01_4_inherit__map">
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for blmc_robots::NJointBlmcRobotDriver&lt; N_JOINTS, N_MOTOR_BOARDS &gt;:</div>
<div class="dyncontent">
<div class="center"><img src="classblmc__robots_1_1NJointBlmcRobotDriver__coll__graph.png" border="0" usemap="#blmc__robots_1_1NJointBlmcRobotDriver_3_01N__JOINTS_00_01N__MOTOR__BOARDS_01_4_coll__map" alt="Collaboration graph"/></div>
<map name="blmc__robots_1_1NJointBlmcRobotDriver_3_01N__JOINTS_00_01N__MOTOR__BOARDS_01_4_coll__map" id="blmc__robots_1_1NJointBlmcRobotDriver_3_01N__JOINTS_00_01N__MOTOR__BOARDS_01_4_coll__map">
<area shape="rect" id="node3" href="classblmc__robots_1_1BlmcJointModules.html" title="blmc_robots::BlmcJointModules\l\&lt; N_JOINTS \&gt;" alt="" coords="61,100,269,141"/>
<area shape="rect" id="node4" href="structblmc__robots_1_1CalibrationParameters.html" title="Parameters for the joint calibration (homing and go to initial pose). " alt="" coords="83,165,246,207"/>
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a9564734eaa1fe694c12a1ef4a2fdd111"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9564734eaa1fe694c12a1ef4a2fdd111"></a>
typedef robot_interfaces::NJointRobotTypes&lt; N_JOINTS &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>Types</b></td></tr>
<tr class="separator:a9564734eaa1fe694c12a1ef4a2fdd111"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00dd0941134c3f67b8580e96d757a754"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00dd0941134c3f67b8580e96d757a754"></a>
typedef Types::Action&#160;</td><td class="memItemRight" valign="bottom"><b>Action</b></td></tr>
<tr class="separator:a00dd0941134c3f67b8580e96d757a754"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9276e8ccd8afd265c6eac1907df2c84"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae9276e8ccd8afd265c6eac1907df2c84"></a>
typedef Types::Observation&#160;</td><td class="memItemRight" valign="bottom"><b>Observation</b></td></tr>
<tr class="separator:ae9276e8ccd8afd265c6eac1907df2c84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44c2dfe4150dfbce81e50bcfb7e609b1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a44c2dfe4150dfbce81e50bcfb7e609b1"></a>
typedef Types::Vector&#160;</td><td class="memItemRight" valign="bottom"><b>Vector</b></td></tr>
<tr class="separator:a44c2dfe4150dfbce81e50bcfb7e609b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a629509d3a20e1dbcba5ccf8ce56f1bfe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a629509d3a20e1dbcba5ccf8ce56f1bfe"></a>
typedef std::array&lt; std::shared_ptr&lt; blmc_drivers::MotorInterface &gt;, N_JOINTS &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>Motors</b></td></tr>
<tr class="separator:a629509d3a20e1dbcba5ccf8ce56f1bfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9a1e5d7dae33b324452fba3418a6fcf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af9a1e5d7dae33b324452fba3418a6fcf"></a>
typedef std::array&lt; std::shared_ptr&lt; blmc_drivers::CanBusMotorBoard &gt;, N_MOTOR_BOARDS &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>MotorBoards</b></td></tr>
<tr class="separator:af9a1e5d7dae33b324452fba3418a6fcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1c0f75dc9a541f7070590ab662eab426"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c0f75dc9a541f7070590ab662eab426"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>NJointBlmcRobotDriver</b> (const MotorBoards &amp;motor_boards, const Motors &amp;motors, const <a class="el" href="structblmc__robots_1_1MotorParameters.html">MotorParameters</a> &amp;motor_parameters, const <a class="el" href="structblmc__robots_1_1CalibrationParameters.html">CalibrationParameters</a> &amp;calibration_parameters, const Vector &amp;safety_kd, const Vector &amp;position_kp, const Vector &amp;position_kd, const bool has_endstop)</td></tr>
<tr class="separator:a1c0f75dc9a541f7070590ab662eab426"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a581bdda9cafb5966425988bc6ca5821f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a581bdda9cafb5966425988bc6ca5821f"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>pause_motors</b> ()</td></tr>
<tr class="separator:a581bdda9cafb5966425988bc6ca5821f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c07ab80770b80db37e8471ec3b77685"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c07ab80770b80db37e8471ec3b77685"></a>
Vector&#160;</td><td class="memItemRight" valign="bottom"><b>get_measured_index_angles</b> () const </td></tr>
<tr class="separator:a5c07ab80770b80db37e8471ec3b77685"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acfe921e947e9dbe5eb74a7c9fb777dfd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acfe921e947e9dbe5eb74a7c9fb777dfd"></a>
Observation&#160;</td><td class="memItemRight" valign="bottom"><b>get_latest_observation</b> () override</td></tr>
<tr class="separator:acfe921e947e9dbe5eb74a7c9fb777dfd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a923c06860fa6aaddd49541b3a836d177"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a923c06860fa6aaddd49541b3a836d177"></a>
Vector&#160;</td><td class="memItemRight" valign="bottom"><b>get_max_torques</b> () const </td></tr>
<tr class="separator:a923c06860fa6aaddd49541b3a836d177"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ae8d7e4d37b3a0ba6966311c9813caec0"><td class="memItemLeft" align="right" valign="top">static MotorBoards&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#ae8d7e4d37b3a0ba6966311c9813caec0">create_motor_boards</a> (const std::array&lt; std::string, N_MOTOR_BOARDS &gt; &amp;can_ports)</td></tr>
<tr class="separator:ae8d7e4d37b3a0ba6966311c9813caec0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a4da9d51841e9b2995e597ae52c460586"><td class="memItemLeft" align="right" valign="top">const bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a4da9d51841e9b2995e597ae52c460586">has_endstop_</a></td></tr>
<tr class="memdesc:a4da9d51841e9b2995e597ae52c460586"><td class="mdescLeft">&#160;</td><td class="mdescRight">True if the joints have mechanical end stops, false if not.  <a href="#a4da9d51841e9b2995e597ae52c460586">More...</a><br /></td></tr>
<tr class="separator:a4da9d51841e9b2995e597ae52c460586"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a4fbd75b68c4dfa8e9320befd546f406a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4fbd75b68c4dfa8e9320befd546f406a"></a>
Action&#160;</td><td class="memItemRight" valign="bottom"><b>apply_action</b> (const Action &amp;desired_action) override</td></tr>
<tr class="separator:a4fbd75b68c4dfa8e9320befd546f406a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51acd154a4769b2fbc35536fc32ca354"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a51acd154a4769b2fbc35536fc32ca354"></a>
Action&#160;</td><td class="memItemRight" valign="bottom"><b>apply_action_uninitialized</b> (const Action &amp;desired_action)</td></tr>
<tr class="separator:a51acd154a4769b2fbc35536fc32ca354"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dc679a59e08fdd97d4bb92f41178445"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1dc679a59e08fdd97d4bb92f41178445"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>shutdown</b> () override</td></tr>
<tr class="separator:a1dc679a59e08fdd97d4bb92f41178445"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56f4a67a3ae5ff481eebd969d1e6374c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a56f4a67a3ae5ff481eebd969d1e6374c">home_on_index_after_negative_end_stop</a> (double torque_ratio, Vector home_offset_rad=Vector::Zero())</td></tr>
<tr class="memdesc:a56f4a67a3ae5ff481eebd969d1e6374c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Homing on negative end stop and encoder index.  <a href="#a56f4a67a3ae5ff481eebd969d1e6374c">More...</a><br /></td></tr>
<tr class="separator:a56f4a67a3ae5ff481eebd969d1e6374c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1defedb3825ccac7cd8511d209bcae61"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a1defedb3825ccac7cd8511d209bcae61">move_to_position</a> (const Vector &amp;goal_pos, const double tolerance, const uint32_t timeout_cycles)</td></tr>
<tr class="memdesc:a1defedb3825ccac7cd8511d209bcae61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move to given goal position using PD control.  <a href="#a1defedb3825ccac7cd8511d209bcae61">More...</a><br /></td></tr>
<tr class="separator:a1defedb3825ccac7cd8511d209bcae61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41b2ff96e0a687b0e1ae06ce1502d4db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a41b2ff96e0a687b0e1ae06ce1502d4db">initialize</a> () override</td></tr>
<tr class="memdesc:a41b2ff96e0a687b0e1ae06ce1502d4db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find home position of all joints and move to start position.  <a href="#a41b2ff96e0a687b0e1ae06ce1502d4db">More...</a><br /></td></tr>
<tr class="separator:a41b2ff96e0a687b0e1ae06ce1502d4db"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a350c204742b25ae2808670b1b56099b8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a350c204742b25ae2808670b1b56099b8"></a>
<a class="el" href="classblmc__robots_1_1BlmcJointModules.html">BlmcJointModules</a>&lt; N_JOINTS &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>joint_modules_</b></td></tr>
<tr class="separator:a350c204742b25ae2808670b1b56099b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a68e9cafdfc02da872dbc86c2fd162408"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a68e9cafdfc02da872dbc86c2fd162408"></a>
MotorBoards&#160;</td><td class="memItemRight" valign="bottom"><b>motor_boards_</b></td></tr>
<tr class="separator:a68e9cafdfc02da872dbc86c2fd162408"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c4b68c6ce49317b2bc15e20c136c2d5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c4b68c6ce49317b2bc15e20c136c2d5"></a>
double&#160;</td><td class="memItemRight" valign="bottom"><b>max_torque_Nm_</b></td></tr>
<tr class="separator:a4c4b68c6ce49317b2bc15e20c136c2d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a988ffd84e127525f630640d8450e7e25"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a988ffd84e127525f630640d8450e7e25"></a>
<a class="el" href="structblmc__robots_1_1CalibrationParameters.html">CalibrationParameters</a>&#160;</td><td class="memItemRight" valign="bottom"><b>calibration_parameters_</b></td></tr>
<tr class="separator:a988ffd84e127525f630640d8450e7e25"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c884b0a6a398dc17c9f642349637143"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1c884b0a6a398dc17c9f642349637143"></a>
Vector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a1c884b0a6a398dc17c9f642349637143">safety_kd_</a></td></tr>
<tr class="memdesc:a1c884b0a6a398dc17c9f642349637143"><td class="mdescLeft">&#160;</td><td class="mdescRight">D-gain to dampen velocity. Set to zero to disable damping. <br /></td></tr>
<tr class="separator:a1c884b0a6a398dc17c9f642349637143"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4397347cbb3ad2e75abc4ad1613b119e"><td class="memItemLeft" align="right" valign="top">Vector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a4397347cbb3ad2e75abc4ad1613b119e">home_offset_rad_</a> = Vector::Zero()</td></tr>
<tr class="memdesc:a4397347cbb3ad2e75abc4ad1613b119e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Offset between home position and zero.  <a href="#a4397347cbb3ad2e75abc4ad1613b119e">More...</a><br /></td></tr>
<tr class="separator:a4397347cbb3ad2e75abc4ad1613b119e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f17c2843ed4cb09953338143e91b45f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5f17c2843ed4cb09953338143e91b45f"></a>
Vector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a5f17c2843ed4cb09953338143e91b45f">initial_position_rad_</a> = Vector::Zero()</td></tr>
<tr class="memdesc:a5f17c2843ed4cb09953338143e91b45f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start position to which the robot moves after homing. <br /></td></tr>
<tr class="separator:a5f17c2843ed4cb09953338143e91b45f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3cc54a0b1bad799b80ab72641f9d24e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae3cc54a0b1bad799b80ab72641f9d24e"></a>
Vector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#ae3cc54a0b1bad799b80ab72641f9d24e">default_position_kp_</a></td></tr>
<tr class="memdesc:ae3cc54a0b1bad799b80ab72641f9d24e"><td class="mdescLeft">&#160;</td><td class="mdescRight">default P-gain for position controller. <br /></td></tr>
<tr class="separator:ae3cc54a0b1bad799b80ab72641f9d24e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a466bd0a736e829536b5d8b6203b68ed9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a466bd0a736e829536b5d8b6203b68ed9"></a>
Vector&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html#a466bd0a736e829536b5d8b6203b68ed9">default_position_kd_</a></td></tr>
<tr class="memdesc:a466bd0a736e829536b5d8b6203b68ed9"><td class="mdescLeft">&#160;</td><td class="mdescRight">default D-gain for position controller. <br /></td></tr>
<tr class="separator:a466bd0a736e829536b5d8b6203b68ed9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abda748741eda4ad890d6e55b09b173d4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abda748741eda4ad890d6e55b09b173d4"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>is_initialized_</b> = false</td></tr>
<tr class="separator:abda748741eda4ad890d6e55b09b173d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt;<br />
class blmc_robots::NJointBlmcRobotDriver&lt; N_JOINTS, N_MOTOR_BOARDS &gt;</h3>

<p>Base class for simple n-joint BLMC robots. </p>
<p>This is a generic base class to easily implement drivers for simple BLMC robots that consist of N_JOINTS joints.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">N_JOINTS</td><td>Number of joints. </td></tr>
    <tr><td class="paramname">N_MOTOR_BOARDS</td><td>Number of motor control boards that are used. </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ae8d7e4d37b3a0ba6966311c9813caec0"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static MotorBoards <a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">blmc_robots::NJointBlmcRobotDriver</a>&lt; N_JOINTS, N_MOTOR_BOARDS &gt;::create_motor_boards </td>
          <td>(</td>
          <td class="paramtype">const std::array&lt; std::string, N_MOTOR_BOARDS &gt; &amp;&#160;</td>
          <td class="paramname"><em>can_ports</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>: reduce the timeout further!! </p>

</div>
</div>
<a class="anchor" id="a56f4a67a3ae5ff481eebd969d1e6374c"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">blmc_robots::NJointBlmcRobotDriver</a>&lt; N_JOINTS, N_MOTOR_BOARDS &gt;::home_on_index_after_negative_end_stop </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>torque_ratio</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Vector&#160;</td>
          <td class="paramname"><em>home_offset_rad</em> = <code>Vector::Zero()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Homing on negative end stop and encoder index. </p>
<p>Procedure for finding an absolute zero position (or "home" position) when using relative encoders.</p>
<p>All joints first move in positive direction until the index of each encoder is found. Then all joints move in negative direction until they hit the end stop. Home position is set to the positions of encoder indices closest to the end stop.</p>
<p>By default, the zero position is the same as the home position. The optional argument home_offset_rad provides a means to move the zero position relative to the home position. The zero position is computed as </p><pre class="fragment">zero position = encoder index position + home offset
</pre><p>Movement is done by simply applying a constant torque to the joints. The amount of torque is a ratio of the configured maximum torque defined by <code>torque_ratio</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">torque_ratio</td><td>Ratio of max. torque that is used to move the joints. </td></tr>
    <tr><td class="paramname">home_offset_rad</td><td>Offset between the home position and the desired zero position. </td></tr>
  </table>
  </dd>
</dl>
<p>Distance after which encoder index search is aborted.</p>
<p>Min. number of steps when moving to the end stop.</p>
<p>Size of the window when computing average velocity.</p>
<p>Velocity limit at which the joints are considered to be stopped </p>

</div>
</div>
<a class="anchor" id="a41b2ff96e0a687b0e1ae06ce1502d4db"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">blmc_robots::NJointBlmcRobotDriver</a>&lt; N_JOINTS, N_MOTOR_BOARDS &gt;::initialize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Find home position of all joints and move to start position. </p>
<p>Homes all joints using home_on_index_after_negative_end_stop. When finished, move the joint to the starting position (defined in <code>initial_position_rad_</code>). </p>

</div>
</div>
<a class="anchor" id="a1defedb3825ccac7cd8511d209bcae61"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">blmc_robots::NJointBlmcRobotDriver</a>&lt; N_JOINTS, N_MOTOR_BOARDS &gt;::move_to_position </td>
          <td>(</td>
          <td class="paramtype">const Vector &amp;&#160;</td>
          <td class="paramname"><em>goal_pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double&#160;</td>
          <td class="paramname"><em>tolerance</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t&#160;</td>
          <td class="paramname"><em>timeout_cycles</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Move to given goal position using PD control. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">goal_pos</td><td>Angular goal position for each joint. </td></tr>
    <tr><td class="paramname">tolerance</td><td>Allowed position error for reaching the goal. This is checked per joint, that is the maximal possible error is +/-tolerance on each joint. </td></tr>
    <tr><td class="paramname">timeout_cycles</td><td>Timeout. If exceeded before goal is reached, the procedure is aborted. Unit: Number of control loop cycles. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if goal position is reached, false if timeout is exceeded. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a4da9d51841e9b2995e597ae52c460586"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const bool <a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">blmc_robots::NJointBlmcRobotDriver</a>&lt; N_JOINTS, N_MOTOR_BOARDS &gt;::has_endstop_</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>True if the joints have mechanical end stops, false if not. </p>
<p>If set to true, it is assumed that all joints of the robot have end stops that mechanically prevent them from moving out of the valid range.</p>
<p>If present, the end stops are used for a fully automated homing procedure in which the joints first move until they hit the end stop before starting the encoder index search. This way it is ensured that the correct index is used for homing without any need for manual set up. </p>

</div>
</div>
<a class="anchor" id="a4397347cbb3ad2e75abc4ad1613b119e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t N_JOINTS, size_t N_MOTOR_BOARDS&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Vector <a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">blmc_robots::NJointBlmcRobotDriver</a>&lt; N_JOINTS, N_MOTOR_BOARDS &gt;::home_offset_rad_ = Vector::Zero()</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Offset between home position and zero. </p>
<p>Defined such that the zero position is at the negative end stop (for compatibility with old homing method). </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/workspace/software/workspace/src/catkin/robots/blmc_robots/include/blmc_robots/<a class="el" href="n__joint__blmc__robot__driver_8hpp_source.html">n_joint_blmc_robot_driver.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespaceblmc__robots.html">blmc_robots</a></li><li class="navelem"><a class="el" href="classblmc__robots_1_1NJointBlmcRobotDriver.html">NJointBlmcRobotDriver</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
